#create function to save figures for book project
savefig <- function(plotobject, filename, filepath = "~/Dropbox/Apps/Overleaf/Credibility Book Master/figures/", width = 5, height, dpi = 300, scale = 1.5, device = "pdf", extension = ".pdf") {
  require(ggplot2)
  ggplot2::ggsave(
    filename = paste0(filepath, filename, extension),
    plot = plotobject,
    width = width,
    height = height,
    dpi = dpi,
    scale = scale,
    device = device
  )
}
